#include<bits/stdc++.h>
using namespace std;
#define REP(i,a,n) for(int i=(a);i<n;i++)
long long a[100100];
int main(){
	freopen("duel.in","r",stdin);
	freopen("duel.out","w",stdout);
	int n;
	scanf("%d",&n);
	REP(i,0,n){
		scanf("%lld",&a[i]);
	}
	sort(a,a+n);
	int k=0,s=0,t=0,ans=0;
	for(int i=n-1;i>=0;i--){
		if(k==a[i])s++;
		if(k!=a[i]){
			k=a[i];
			t+=s;
			s=1;
		}
		if(t){
			t--;
			ans++;
		}
	}
	cout<<n-ans<<endl;
	return 0;
}
